package com.feng.eduservice.controller;


import com.feng.commonutils.R;
import com.feng.eduservice.service.EduSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.multipart.MultipartFile;

/**
 * <p>
 * 课程科目 前端控制器
 * </p>
 *
 * @author fengge
 * @since 2023-01-15
 */
@RestController
@RequestMapping("/eduservice/edu-subject")
@CrossOrigin
public class EduSubjectController {
    @Autowired
    private EduSubjectService eduSubjectService;
    //添加课程分类
    //获取上传的文件，将文件内容读取出来
    @PostMapping("addSubject")
    public R addSubject(MultipartFile file){
       //上传过来的excel文件file
        return eduSubjectService.addSubject(file);
    }
    //课程分类列表功能(树形)
    @GetMapping("getAllSubject")
    public R getAllSubject(){
        return eduSubjectService.getAllSubject();
    }
}

